package ru.amse.tsyganov.jumleditor.view.preferences;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Cursor;

public class Cursors {
	
	private static Cursor cursorArrow;
	
	private static Cursor cursorArrowPlus;
	
	private static Cursor cursorSizeW;
	
	private static Cursor cursorSizeNW;
	
	private static Cursor cursorSizeNE;
	
	private static Cursor cursorSizeN;
	
	private static Cursor cursorSizeE;
	
	private static Cursor cursorSizeAll;
	
	private static Cursor cursorNo;
	
	private static Cursor cursorCross;
	
	private static Cursor cursorSizeNS;

	private static Cursor cursorSizeWE;
	
	public static Cursor getCursorArrow() {
		if (cursorArrow == null) {
			cursorArrow = new Cursor(null, SWT.CURSOR_ARROW);
		}
		return cursorArrow;
	}
	
	public static Cursor getCursorArrowPlus() {
		if (cursorArrowPlus == null) {
			cursorArrowPlus = new Cursor(null, SWT.CURSOR_ARROW);
			//new Cursor(null, new ImageData("icons/mouse_plus.GIF"), 3, 3);
		}
		return cursorArrowPlus;
	}

	public static Cursor getCursorSizeW() {
		if (cursorSizeW == null) {
			cursorSizeW = new Cursor(null, SWT.CURSOR_SIZEW);
		}
		return cursorSizeW;
	}
	
	public static Cursor getCursorSizeNW() {
		if (cursorSizeNW == null) {
			cursorSizeNW = new Cursor(null, SWT.CURSOR_SIZENW);
		}
		return cursorSizeNW;
	}
	
	public static Cursor getCursorSizeNE() {
		if (cursorSizeNE == null) {
			cursorSizeNE = new Cursor(null, SWT.CURSOR_SIZENE);
		}
		return cursorSizeNE;
	}
	
	public static Cursor getCursorSizeN() {
		if (cursorSizeN == null) {
			cursorSizeN = new Cursor(null, SWT.CURSOR_SIZEN);
		}
		return cursorSizeN;
	}
	
	public static Cursor getCursorSizeE() {
		if (cursorSizeE == null) {
			cursorSizeE = new Cursor(null, SWT.CURSOR_SIZEE);
		}
		return cursorSizeE;
	}
	
	public static Cursor getCursorSizeAll() {
		if (cursorSizeAll == null) {
			cursorSizeAll = new Cursor(null, SWT.CURSOR_SIZEALL);
		}
		return cursorSizeAll;
	}
	
	public static Cursor getCursorNo() {
		if (cursorNo == null) {
			cursorNo = new Cursor(null, SWT.CURSOR_NO);
		}
		return cursorNo;
	}
	
	public static Cursor getCursorCross() {
		if (cursorCross == null) {
			cursorCross = new Cursor(null, SWT.CURSOR_CROSS);
		}
		return cursorCross;
	}
	
	public static Cursor getCursorSizeNS() {
		if (cursorSizeNS == null) {
			cursorSizeNS = new Cursor(null, SWT.CURSOR_SIZENS);
		}
		return cursorSizeNS;
	}
	
	public static Cursor getCursorSizeWE() {
		if (cursorSizeWE == null) {
			cursorSizeWE = new Cursor(null, SWT.CURSOR_SIZEWE);
		}
		return cursorSizeWE;
	}
	
	public static void dispose() {
		if (cursorArrow == null) {
			cursorArrow.dispose();
		}
		
		if (cursorSizeW == null) {
			cursorSizeW.dispose();
		}
		
		if (cursorSizeNW == null) {
			cursorSizeNW.dispose();
		}
		
		if (cursorSizeNE == null) {
			cursorSizeNE.dispose();
		}
		
		if (cursorSizeN == null) {
			cursorSizeN.dispose();
		}
		
		if (cursorSizeE == null) {
			cursorSizeE.dispose();
		}
		
		if (cursorSizeAll == null) {
			cursorSizeAll.dispose();
		}
		
		if (cursorNo == null) {
			cursorNo.dispose();
		}
		
		if (cursorArrowPlus == null) {
			cursorArrowPlus.dispose();
		}
		
		if (cursorCross == null) {
			cursorCross.dispose();
		}
		
		if (cursorSizeNS == null) {
			cursorSizeNS.dispose();
		}
		
		if (cursorSizeWE == null) {
			cursorSizeWE.dispose();
		}
	}
}
